package com.hnhs.threadLocal;

import com.hnhs.info.PageInfo;

public class LocalPageInfoUtil {
  //创建一个线程对象
    private static  ThreadLocal<PageInfo> localPageInfoUtil = new ThreadLocal<>();
  //设置线程 用于赋值 {k,v}{total: 4}
    public static  void set(PageInfo pageInfo){
        localPageInfoUtil.set(pageInfo);
    }
    //获取线程共享数据 get方法只是只读
    public static PageInfo get(){
        return localPageInfoUtil.get();
    }
    //线程删除 把标签删除掉
    public static void remove(){
        localPageInfoUtil.remove();
    }


}
